addChild

open fun addChild(parent: T, child: T)

Add a node to a parent. To be valid, the parent must be a member and the child must not be a member of the tree.

Parameters

parent

the node in the tree to add a new node to

child

a node to add to the tree

Throws

if the parent is not a member or the child already is a member of the tree

if either argument is null